import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_project/route/index.dart';
import 'package:provider/provider.dart';

import 'core/manager/storage_manager.dart';
import 'core/util/platform_util.dart';

final Router router = Router();

void main() async {
  Provider.debugCheckInvalidValueType = null;
  WidgetsFlutterBinding.ensureInitialized();
  await SharedPreferencesManager().init();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.light(),
      initialRoute: '/',
      onGenerateRoute: router.generateRoute,
    );
  }
}
